home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / AppleScript.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  5.5 KB  |  180 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        AppleScript.p
  3.  
  4.      Contains:    AppleScript Specific Interfaces.
  5.  
  6.      Version:    Technology:    AppleScript 1.1
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT AppleScript;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __APPLESCRIPT__}
  28. {$SETC __APPLESCRIPT__ := 1}
  29.  
  30. {$I+}
  31. {$SETC AppleScriptIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __ERRORS__}
  35. {$I Errors.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __APPLEEVENTS__}
  38. {$I AppleEvents.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __OSA__}
  41. {$I OSA.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __TEXTEDIT__}
  44. {$I TextEdit.p}
  45. {$ENDC}
  46.  
  47.  
  48. {$PUSH}
  49. {$ALIGN MAC68K}
  50. {$LibExport+}
  51.  
  52. {*************************************************************************
  53.     Types and Constants
  54. *************************************************************************}
  55. {
  56.     The specific type for the AppleScript instance of the
  57.     Open Scripting Architecture type.
  58. }
  59.  
  60. CONST
  61.     typeAppleScript                = 'ascr';
  62.     kAppleScriptSubtype            = 'ascr';
  63.     typeASStorage                = 'ascr';
  64.  
  65. {*************************************************************************
  66.     Component Selectors
  67. *************************************************************************}
  68.  
  69.     kASSelectInit                = $1001;
  70.     kASSelectSetSourceStyles    = $1002;
  71.     kASSelectGetSourceStyles    = $1003;
  72.     kASSelectGetSourceStyleNames = $1004;
  73.  
  74.  
  75. {*************************************************************************
  76.     OSAGetScriptInfo Selectors
  77. *************************************************************************}
  78.     kASHasOpenHandler            = 'hsod';
  79.  
  80. {
  81.         This selector is used to query a context as to whether it contains
  82.         a handler for the kAEOpenDocuments event. This allows "applets" to be 
  83.         distinguished from "droplets."  OSAGetScriptInfo returns false if
  84.         there is no kAEOpenDocuments handler, and returns the error value 
  85.         errOSAInvalidAccess if the input is not a context.
  86.     }
  87. {*************************************************************************
  88.     Initialization
  89. *************************************************************************}
  90. FUNCTION ASInit(scriptingComponent: ComponentInstance; modeFlags: LONGINT; minStackSize: LONGINT; preferredStackSize: LONGINT; maxStackSize: LONGINT; minHeapSize: LONGINT; preferredHeapSize: LONGINT; maxHeapSize: LONGINT): OSAError;
  91.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  92.     INLINE $2F3C, $001C, $1001, $7000, $A82A;
  93.     {$ENDC}
  94. {
  95.         ComponentCallNow(kASSelectInit, 28);
  96.         This call can be used to explicitly initialize AppleScript.  If it is
  97.         not called, the a scripting size resource is looked for and used. If
  98.         there is no scripting size resource, then the constants listed below
  99.         are used.  If at any stage (the init call, the size resource, the 
  100.         defaults) any of these parameters are zero, then parameters from the
  101.         next stage are used.  ModeFlags are not currently used.
  102.         Errors:
  103.         errOSASystemError        initialization failed
  104.     }
  105. {
  106.     These values will be used if ASInit is not called explicitly, or if any
  107.     of ASInit's parameters are zero:
  108. }
  109.  
  110. CONST
  111.     kASDefaultMinStackSize        = 4096;
  112.     kASDefaultPreferredStackSize = 16384;
  113.     kASDefaultMaxStackSize        = 16384;
  114.     kASDefaultMinHeapSize        = 4096;
  115.     kASDefaultPreferredHeapSize    = 16384;
  116.     kASDefaultMaxHeapSize        = 33554432;
  117.  
  118. {*************************************************************************
  119.     Source Styles
  120. *************************************************************************}
  121. FUNCTION ASSetSourceStyles(scriptingComponent: ComponentInstance; sourceStyles: STHandle): OSAError;
  122.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  123.     INLINE $2F3C, $0004, $1002, $7000, $A82A;
  124.     {$ENDC}
  125. {
  126.         ComponentCallNow(kASSelectSetSourceStyles, 4);
  127.         Errors:
  128.         errOSASystemError        operation failed
  129.     }
  130. FUNCTION ASGetSourceStyles(scriptingComponent: ComponentInstance; VAR resultingSourceStyles: STHandle): OSAError;
  131.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  132.     INLINE $2F3C, $0004, $1003, $7000, $A82A;
  133.     {$ENDC}
  134. {
  135.         ComponentCallNow(kASSelectGetSourceStyles, 4);
  136.         Errors:
  137.         errOSASystemError        operation failed
  138.     }
  139. FUNCTION ASGetSourceStyleNames(scriptingComponent: ComponentInstance; modeFlags: LONGINT; VAR resultingSourceStyleNamesList: AEDescList): OSAError;
  140.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  141.     INLINE $2F3C, $0008, $1004, $7000, $A82A;
  142.     {$ENDC}
  143. {
  144.         ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  145.         This call returns an AEList of styled text descriptors the names of the
  146.         source styles in the current dialect.  The order of the names corresponds
  147.         to the order of the source style constants, below.  The style of each
  148.         name is the same as the styles returned by ASGetSourceStyles.
  149.         
  150.         Errors:
  151.         errOSASystemError        operation failed
  152.     }
  153. {
  154.     Elements of STHandle correspond to following categories of tokens, and
  155.     accessed through following index constants:
  156. }
  157.  
  158. CONST
  159.     kASSourceStyleUncompiledText = 0;
  160.     kASSourceStyleNormalText    = 1;
  161.     kASSourceStyleLanguageKeyword = 2;
  162.     kASSourceStyleApplicationKeyword = 3;
  163.     kASSourceStyleComment        = 4;
  164.     kASSourceStyleLiteral        = 5;
  165.     kASSourceStyleUserSymbol    = 6;
  166.     kASSourceStyleObjectSpecifier = 7;
  167.     kASNumberOfSourceStyles        = 8;
  168.  
  169.  
  170. {$ALIGN RESET}
  171. {$POP}
  172.  
  173. {$SETC UsingIncludes := AppleScriptIncludes}
  174.  
  175. {$ENDC} {__APPLESCRIPT__}
  176.  
  177. {$IFC NOT UsingIncludes}
  178.  END.
  179. {$ENDC}
  180.